package com.wsl.config;

import com.wsl.Bean.BeanWayService;
import com.wsl.Bean.JSR250WayService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @Author:WangShuliang
 * @Description:
 * @Date:Created in 14:33 2017/11/24
 * @Modified by:
 */
@Configuration
@ComponentScan("com.wsl")
public class PrePostConfig {
    /**
     *  initMethod 和 destroyMethod指定BeanWayService类的init和destroy方法在
     *  构造方法之后 Bean销毁之前运行
     * @return
     */
    @Bean(initMethod = "init",destroyMethod = "destroy")
    BeanWayService beanWayService(){
        return  new BeanWayService();
    }
    @Bean
    JSR250WayService jsr250WayService(){
        return new JSR250WayService();
    }
}